package com.example.demo.controller;

import org.jodconverter.JodConverter;
import org.jodconverter.office.OfficeException;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.File;

@RestController
@RequestMapping("office")
public class OfficeController {

    @GetMapping("convert")
    public void convert() throws OfficeException {
        File file = new File("D:\\workspacee\\杰橙云连锁后台管理\\杰橙云单店\\交接文档.docx");
        JodConverter.convert(file).to(new File("D:\\workspacee\\杰橙云连锁后台管理\\杰橙云单店\\交接文档.pdf")).execute();
    }
}
